import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false
import router from '@/router'
import store from '@/store'

// 全局组件引入
import TypeNav from '@/components/TypeNav'
import Carousel from '@/components/Carousel'
import pagination from '@/components/pagination'
//全局组件注册
Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(pagination.name, pagination)
    // 引入mockServe文件 
import '@/mock/mockServe'
// 引入swiperCss样式
import 'swiper/css/swiper.css'


// 将api文件导入 进行封装挂载
import * as API from '@/api'


// 按需引入 (支付页面的弹出框功能)
import { Button, MessageBox } from 'element-ui'
Vue.use(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// ----

// 引入图片懒加载插件
import VueLazyload from 'vue-lazyload'
// 图片与json无需暴露 可直接导入使用
import img from '@/assets/1.gif'

Vue.use(VueLazyload, {
        loading: img
    })
    // ----

// 导入表单验证插件 
import '@/plugins/validate'

new Vue({
    render: h => h(App),

    beforeCreate: function() {
        Vue.prototype.$bus = this

        Vue.prototype.$API = API
    },
    router,
    store,

}).$mount('#app')